package power.game.sixtysix.logic;

import power.game.sixtysix.entity.Card;
import power.game.sixtysix.entity.CardColor;

public class Round {

	private Card firstCard;
	private Card secondCard;
	private int firstPlayerId;
	private int secondPlayerId;
	private CardColor talon;
	
	public Round(CardColor talon) {
		this.talon = talon;
	}
	
	public int getWinner() {
		if (firstCard == null || secondCard == null) return -1;
		return firstCard.compare(secondCard, talon) ? firstPlayerId : secondPlayerId;
	}
	
	public void putCard(int playerId, Card card) {
		if (firstCard == null) {
			firstCard = card;
			firstPlayerId = playerId;
		} else {
			secondCard = card;
			secondPlayerId = playerId;
		}
	}
	
	public Card getFirstCard() {
		return firstCard;
	}
	
	public Card getSecondCard() {
		return secondCard;
	}
}
